package com.vodafone.nowplus.android.peoplemail.filter;

import java.util.List;

public interface FilterManager {

	
	/**
	 * clears filters managed by FilterManager. To be called before notifying of existing folders.
	 */
	void clearFilters();
	
	/**
	 * notify the FilterManager that a certain folder exists. 
	 * The FilterManager implementation should know if to create a filter internally
	 * @param folderName
	 */
	void notifyOfExistingFolder(String folderName);
	
	/**
	 * @return list of registered filters.
	 */
	List<MessageListFilter> getFilters();
	
	
	/**
	 * @param id
	 * @return
	 */
	//MessageListFilter getFilterByType(String id);
	
	
	
	/**
	 * @param filter
	 * @param folderName
	 * @return true if given filter matches given folder.
	 */
	boolean matchesFilter(MessageListFilter filter, String folderName);
	
	/**
	 * @param filterName
	 * @param folderName
	 * @return true if filter with given filterName matches folder.
	 */
	boolean matchesFilter(String filterName, String folderName);
	
	/**
	 * @param folderName
	 * @return filter which fits given folderName or null if none found. If multiple filters fit, the first is returned.
	 */
	MessageListFilter getFilterForFolderName(String folderName);

	/**
	 * @param messageFilterName
	 * @return
	 */
	MessageListFilter getFilterByName(String messageFilterName);
	
}
